package com.pl.rabarbar.convert;

import java.util.List;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.sun.jersey.api.uri.UriComponent.Type;

public class ConvertJson {

	public static String convertToJson(Object obj) {
		Gson gson = new Gson();
		return gson.toJson(obj);
	}

	public static List convertFromJsonToList(String str) {
		Gson gson = new Gson();
		java.lang.reflect.Type type = new TypeToken<List<String>>() {
		}.getType();
		return gson.fromJson(str, type);

	}
}
